/*发送消息*/
var user = sessionStorage.getItem("user");
function send(headSrc,str){
	var html="<div class='send'><div class='msg'><img src="+headSrc+" />"+
	"<p><i class='msg_input'></i>"+str+"</p></div></div>";
	upView(html);
}
/*接受消息*/
function show(headSrc,str){
	var html="<div class='show'><div class='msg'><img src="+headSrc+" />"+
	"<p><i class='msg_input'></i>"+str+"</p></div></div>";
	upView(html);
}
/*更新视图*/
function upView(html){
	$('.message').append(html);
	$('body').animate({scrollTop:$('.message').outerHeight()-window.innerHeight},200)
}
function sj(){
	return parseInt(Math.random()*10)
}


/*测试数据*/
/*var arr=['怎么不和我说话','跟我聊会天吧'];
var imgarr=['/img/chat/touxiang.png','/img/chat/touxiangm.png']
test()
function test(){
	$(arr).each(function(i){
		setTimeout(function(){
			send("/img/chat/touxiang.png",arr[i])
		},sj()*500)
	})
}*/
